package cn.oversky.eom;

import cn.oversky.eom.rule.FormValueRule;
import cn.oversky.eom.rule.IFormValueRule;

import static cn.oversky.eom.model.ThirdPartyConstant.*;

/**
 * @email yeweicheng@xdf.cn
 * @data 2017/5/16 21:48.
 * Now is history !
 */
public enum ValueRuleEnum {

    resumeNameNotNullRule( new FormValueRule( true, "姓名不能为空" ) ),
    mobileRule( new FormValueRule( GLOBAL_PHONE_REGEXP, "手机号码格式有误，请检查", "手机号码不能为空", true) ),
    emailRule( new FormValueRule( "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", "电子邮箱格式有误，请检查") ),
    birthdayRule( new FormValueRule( EXCEL_DATE_REGEXP, "出生日期格式有误，格式为：yyyy/MM/dd或yyyy-MM-dd") );
    private IFormValueRule rule;

    ValueRuleEnum(IFormValueRule rule) {
        this.rule = rule;
    }

    public IFormValueRule getRule() {
        return this.rule;
    }

}
